import re
a = 'C|C++|Python|Java'
# r = re.findall('Python', a)

'''
  a[0-9a-z]d
  \d 数字 = [0-9]
  \D 非数字 = [^0-9]
  \w 字符 = [0-9a-zA-Z]
  \W 非字符 = [^0-9a-zA-Z] 空格\s 回车\n 制表符\t
  \n 回车 
'''


# r = re.sub('\d','1', a)
# # 从字符串首字母开始匹配
# r2 = re.match()
# # 搜索
# r3 = re.search()
# print(r)


s = 'life is short, i use python'

r = re.search('life(.*)python', s)
print(r.group(0))
print(r.group(1))

